package com.deng.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.Set;

/**
 * @Author 邓小熙
 * @Date 2022/5/30 10:54
 * @Version 1.0
 */
@Mapper
@Component
public interface PermissionMapper {
    @Select("SELECT permission_name " +
            "FROM social_blog.permission p,social_blog.user_role_permission urp,social_blog.users u " +
            "WHERE p.id = urp.permisssion_id AND urp.user_id = u.id AND u.login_name= #{name}")
    Set<String> findPermissionByName(@Param("name") String name);
}
